package com.ytjj.qmyx.mall.controller.app;

import com.ytjj.common.api.CommonResult;
import com.ytjj.qmyx.mall.model.response.BrandListResponse;
import com.ytjj.qmyx.mall.service.EvaluationServive;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 *
 *  *
 **/
@RestController
@RequestMapping("brand/pavilion")
public class AppBrandPavilionController {

    @Resource
    private EvaluationServive evaluationServive;

    /**
     * 根据专区id去查询品牌列表
     * @return
     */
    @GetMapping("/get")
    public CommonResult queryBankerListById(@RequestParam(value = "pageNum") Integer pageNum,
                                            @RequestParam(value = "pageSize") Integer pageSize,
                                            @RequestParam(value = "specialId") Integer specialId){
        List<BrandListResponse> bankerSiteInfoList = evaluationServive.getAppBrandPavilionList(pageNum,pageSize,specialId);
        return CommonResult.success(bankerSiteInfoList);
    }

    /**
     * 根据专区id去查询品牌列表(new 通过专区找分类再找商品)
     * @return
     */
    @GetMapping("/getNew")
    public CommonResult queryBankerListByIdNew(@RequestParam(value = "pageNum") Integer pageNum,
                                            @RequestParam(value = "pageSize") Integer pageSize,
                                            @RequestParam(value = "specialId") Integer specialId){
        List<BrandListResponse> bankerSiteInfoList = evaluationServive.getAppBrandPavilionListNew(pageNum,pageSize,specialId);
        return CommonResult.success(bankerSiteInfoList);
    }

    /**
     * 品牌内页
     * @return
     */
    @GetMapping("/info")
    public CommonResult queryBankerInfo(@RequestParam(value = "pageNum",required = false,defaultValue = "1000") Integer pageNum,
                                            @RequestParam(value = "pageSize",required = false, defaultValue = "1") Integer pageSize,
                                            @RequestParam Integer id){
        return CommonResult.success(evaluationServive.getAppBrandPavilionInfo(pageNum,pageSize,id));
    }
}
